<template>
  <div class="item">
    <div class="left">
      <img v-lazy="info.poster" @click="goDetail(info.filmId)" />
    </div>
    <div class="middle">
      <div>{{ info.name }}</div>
      <div>
        <span>观众评分</span>
        <span>7.6</span>
      </div>
      <div>主演：{{ info.actorsStr }}</div>
      <div>中国大陆 | 150分钟</div>
    </div>
    <div class="right" @click="goDetail(info.filmId)">
      <span>购票</span>
    </div>
  </div>
</template>

<script>
export default {
  props: ['info'],
  methods: {
    goDetail(id) {
      // console.log(id);
      // this.$router.push(`/detail/${id}`)
      this.$emit('routerClick',id)
    }
  }
}
</script>

<style lang="scss" scoped>
.item {
  margin-top: 15px;
  /* padding-bottom: 15px; */
  display: flex;
  color: #797d82;
  font-size: 13px;
  &:last-child {
    margin-bottom: 50px;
    border-bottom: none;
  }
  .left {
    width: 77px;
    height: 100px;
    /* margin-left: 20px; */
    img {
      width: 66px;
      height: 100%;
    }
  }

  .middle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 55%;

    div:nth-of-type(1) {
      color: #191a1b;
      font-size: 16px;
    }

    /* 文字超过后,隐藏,用... 只对中文,英文无效 */
    div:nth-of-type(3) {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .right {
    width: 15%;
    display: flex;
    align-items: center;
    margin-right: 20px;

    span {
      border: 1px solid #ff5f16;
      background: white;
      color: #ff5f16;
      border-radius: 2px;
      height: 25px;
      line-height: 25px;
      font-size: 13px;
      width: 50px;
      text-align: center;
    }
  }
}
</style>
